FileCopy

 

The 'FileCopy' function copies the specified file.

 

int FileCopy(string source_file, string target_file, char bFailIfExist);

 

Parameters

string source_file : original file name including the absolute path

string target_file : target file name including the absolute path

bFailIfExist : processing option (0 = If the target file name exists, the file copy as the overwrite mode is executed. 1= If the target file name exists, the file copy isn't executed.)

 

Return Value

result (1 = success, 0 = fail)

 

Example

result = @FileCopy("C:\\TEXT1.TXT", "D:\\TEXT2.TXT", 1);

if(result == 1)

{

@Message("The file copy success");

}

else

{

 @Message("The file copy fail");

}

Description : The first line copies 'C:\\TEXT1.TXT' onto 'D:\\TEXT2.TXT' and stores the result in the variable named 'result'. If 'result' is '1', 'The file copy success' message will be displayed on the screen. If 'result' is '0', 'The file copy fail' message will be displayed on the screen.